{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sheet 2\n",
    "\n",
    "### Exercise1: Dataset\n",
    "\n",
    "To do at the home, generate 10 datapoints from gaussian first and then used those for the "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1000\n",
      "236\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "mu, sigma = 0, 0.1 # mean and standard deviation\n",
    "size = (1000,2 )\n",
    "dataset = np.random.normal(mu,sigma,size)\n",
    "y = []\n",
    "positive = [ (x1,x2) for (x1,x2) in dataset if x1 >= 0 and x2 >= 0]\n",
    "negative = [ (x1,x2) for (x1,x2) in dataset if x1 < 0 or x2 < 0 ]\n",
    "\n",
    "for (x1,x2) in dataset:\n",
    "    if x1 >= 0 and x2 >= 0:\n",
    "        y.append(1)\n",
    "    else:\n",
    "        y.append(0)\n",
    "        \n",
    "print (len(y))\n",
    "print (len(positive))\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# meshgrid or meshplot "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Exercise2: Bayes Surface"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reference:\n",
    "https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.normal.html"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [conda root]",
   "language": "python",
   "name": "conda-root-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
